#ifndef __BASE_TYPES_H__
#define __BASE_TYPES_H__

#include <stdio.h>
// #include <stdLib.h>
#include <stdarg.h>
#include <string.h>
#include <ctype.h>
#include <time.h>

#ifdef __cplusplus
extern "C"
{
#endif

#ifndef u08
    typedef unsigned char u08;
#endif

#ifndef s08
    typedef signed char s08;
#endif

#ifndef u16
    typedef unsigned short u16;
#endif

#ifndef s16
    typedef signed short s16;
#endif

#ifndef u32
    typedef unsigned int u32;
#endif

#ifndef s32
    typedef signed int s32;
#endif

#ifndef ull
    typedef unsigned long long int ull;
#endif

#ifndef sll
    typedef signed long long int sll;
#endif

#ifndef pu08
    typedef unsigned char *pu08;
#endif

#ifndef ps08
    typedef signed char *ps08;
#endif

#ifndef pu16
    typedef unsigned short *pu16;
#endif

#ifndef ps16
    typedef signed short *ps16;
#endif

#ifndef pu32
    typedef unsigned int *pu32;
#endif

#ifndef ps32
    typedef signed int *ps32;
#endif

#ifndef STATUS
    typedef int STATUS;
#endif

    typedef long int Word32;
    typedef short int Word16;
    typedef short int Flag;

#ifndef BYTE
    typedef unsigned char BYTE;
#endif

#ifndef WORD
    typedef unsigned short WORD;
#endif

#ifndef DWORD
    typedef unsigned long DWORD;
#endif

    // #ifndef size_t
    //     typedef unsigned int size_t;
    // #endif

#ifndef __cplusplus

#ifndef bool
#define bool signed long
#endif

#ifndef true
#define true 1
#endif

#ifndef false
#define false 0
#endif

#endif

    // #ifdef __cplusplus
    //     typedef long (*FUNCPTR)(...);
    //     typedef void (*VOIDFUNCPTR)(...);
    //     typedef double (*DBLFUNCPTR)(...);
    //     typedef float (*FLTFUNCPTR)(...);
    // #else
    // typedef long (*FUNCPTR)();
    // typedef void (*VOIDFUNCPTR)();
    // typedef double (*DBLFUNCPTR)();
    // typedef float (*FLTFUNCPTR)();
    // #endif

#define NONE (-1) /* for times when NULL won't do */
#define EOS '\0'  /* C string terminator */

#define BASE_OK (0)
#define BASE_ERROR (-1)

#ifndef OK
#define OK (0)
#endif

#ifndef ERROR
#define ERROR (-1)
#endif

#ifdef __cplusplus
}
#endif
#endif